package cn.gok;


class Book{
    private String bookName;//通过私有访问限制符
    private int pageCount;

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }
}
public class 封装 {
    public static void main(String[] args) {
        Book book =new Book();
        book.setBookName("xiyouji");
        book.setPageCount(100);
    }
}
